//
//  TheMoreViewController.m
//  PLRLiveShow
//
//  Created by 赵小燕 on 2017/8/14.
//  Copyright © 2017年 xiaoyanzhao. All rights reserved.
//

#import "TheMoreViewController.h"
#import "MoreView.h"
#import "CellDataModel.h"
#import "SectionDataModel.h"

@interface TheMoreViewController ()

@property (nonatomic, strong) MoreView *moreView;
@property (nonatomic, strong) NSMutableArray *dataModelArray;
//@property (nonatomic, strong) SectionDataModel *sectionDataModel;

@end

@implementation TheMoreViewController

- (void)viewDidLoad {
    [super viewDidLoad];
        
    self.navigationController.navigationBarHidden = YES;
    
    [self loadData];
    
    _moreView = [[MoreView alloc] initWithFrame:self.view.frame withArray:_dataModelArray];
    [self.view addSubview:_moreView];
    self.view.backgroundColor = [UIColor whiteColor];
    
    // 如果不设置,顶部会出现状态栏为白色,也就是不遮挡状态栏
    self.automaticallyAdjustsScrollViewInsets = NO;
}

- (void)loadData {
    _dataModelArray = [[NSMutableArray alloc] init];
    SectionDataModel *sectionDataModel = [[SectionDataModel alloc] init];
    CellDataModel *dataModel = [[CellDataModel alloc] initwithLeftTitle:@"我的等级" rightTitle:@"LV1"];
    [sectionDataModel addObjects:dataModel, nil];
    [_dataModelArray addObject:sectionDataModel];
    
    CellDataModel *dataModel1 = [[CellDataModel alloc] initwithLeftTitle:@"我的粉丝" rightTitle:nil];
    SectionDataModel *sectionDataModel1 = [[SectionDataModel alloc] init];
    [sectionDataModel1 addObjects:dataModel1, nil];
    [_dataModelArray addObject:sectionDataModel1];
    
    CellDataModel *dataModel2 = [[CellDataModel alloc] initwithLeftTitle:@"语音开黑" rightTitle:nil];
    CellDataModel *dataModel3 = [[CellDataModel alloc] initwithLeftTitle:@"游戏中心" rightTitle:nil];
    CellDataModel *dataModel4 = [[CellDataModel alloc] initwithLeftTitle:@"我的账户" rightTitle:nil];
    SectionDataModel *sectionDataModel2 = [[SectionDataModel alloc] init];
    [sectionDataModel2 addObjects:dataModel2,dataModel3, dataModel4, nil];
    [_dataModelArray addObject:sectionDataModel2];
    
    CellDataModel *dataModel5 = [[CellDataModel alloc] initwithLeftTitle:@"我的视频" rightTitle:nil];
    CellDataModel *dataModel6 = [[CellDataModel alloc] initwithLeftTitle:@"视频收藏" rightTitle:nil];
    SectionDataModel *sectionDataModel3 = [[SectionDataModel alloc] init];
    [sectionDataModel3 addObjects:dataModel5, dataModel6, nil];
    [_dataModelArray addObject:sectionDataModel3];
    
    CellDataModel *dataModel7 = [[CellDataModel alloc] initwithLeftTitle:@"历史记录" rightTitle:nil];
    CellDataModel *dataModel8 = [[CellDataModel alloc] initwithLeftTitle:@"关注管理" rightTitle:nil];
    SectionDataModel *sectionDataModel4 = [[SectionDataModel alloc] init];
    [sectionDataModel4 addObjects:dataModel7,dataModel8, nil];
    [_dataModelArray addObject:sectionDataModel4];
    
    CellDataModel *dataModel9 = [[CellDataModel alloc] initwithLeftTitle:@"开播提醒" rightTitle:nil];
    CellDataModel *dataModel10 = [[CellDataModel alloc] initwithLeftTitle:@"排行榜" rightTitle:nil];
    SectionDataModel *sectionDataModel5 = [[SectionDataModel alloc] init];
    [sectionDataModel5 addObjects:dataModel9, dataModel10, nil];
    [_dataModelArray addObject:sectionDataModel5];

}


@end
